#include <func.h>
#include "head.h"

int getSalt(char salt[]){
    int i, flag;
    srand(time(NULL));
    char arr[SALT_LEN - 4];
    for(i = 0; i < SALT_LEN - 4; i++){
        flag = rand()%3;
        switch(flag){
            case 0:
                arr[i] = rand()%26 + 'a';
                break;
            case 1:
                arr[i] = rand()%26 + 'A';
                break;
            case 2:
                arr[i] = rand()%10 + '0';
                break;
        }
    }
    sprintf(salt, "$6$%s$", arr);
}